<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Distribution.Compat.Exception</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-3"></span><span>  </span><span class="annot"><a href="Distribution.Compat.Exception.html#catchIO"><span class="hs-identifier">catchIO</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-4"></span><span>  </span><span class="annot"><a href="Distribution.Compat.Exception.html#catchExit"><span class="hs-identifier">catchExit</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-5"></span><span>  </span><span class="annot"><a href="Distribution.Compat.Exception.html#tryIO"><span class="hs-identifier">tryIO</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-6"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#displayException"><span class="hs-identifier">displayException</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-7"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#ifdef MIN_VERSION_base
</span><span class="hs-cpp">#define MINVER_base_48 MIN_VERSION_base(4,8,0)
</span><span class="hs-cpp">#else
</span><span class="hs-cpp">#define MINVER_base_48 (__GLASGOW_HASKELL__ &gt;= 710)
</span><span class="hs-cpp">#endif
</span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.Exit.html#"><span class="hs-identifier">System.Exit</span></a></span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Control.Exception.html#"><span class="hs-identifier">Control.Exception</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Exception</span></span><span class="hs-cpp">

#if MINVER_base_48
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Exception.html#"><span class="hs-identifier">Control.Exception</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#displayException"><span class="hs-identifier">displayException</span></a></span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- | Try 'IOException'.</span><span>
</span><span id="line-23"></span><span id="local-6989586621679612260"><span class="annot"><a href="Distribution.Compat.Exception.html#tryIO"><span class="hs-identifier hs-type">tryIO</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679612260"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#IOException"><span class="hs-identifier hs-type">Exception.IOException</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612260"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-24"></span><span id="tryIO"><span class="annot"><span class="annottext">tryIO :: forall a. IO a -&gt; IO (Either IOException a)
</span><a href="Distribution.Compat.Exception.html#tryIO"><span class="hs-identifier hs-var hs-var">tryIO</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; IO (Either IOException a)
forall e a. Exception e =&gt; IO a -&gt; IO (Either e a)
</span><a href="../../base/src/Control.Exception.Base.html#try"><span class="hs-identifier hs-var">Exception.try</span></a></span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span class="hs-comment">-- | Catch 'IOException'.</span><span>
</span><span id="line-27"></span><span id="local-6989586621679612254"><span class="annot"><a href="Distribution.Compat.Exception.html#catchIO"><span class="hs-identifier hs-type">catchIO</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679612254"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#IOException"><span class="hs-identifier hs-type">Exception.IOException</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679612254"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679612254"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-28"></span><span id="catchIO"><span class="annot"><span class="annottext">catchIO :: forall a. IO a -&gt; (IOException -&gt; IO a) -&gt; IO a
</span><a href="Distribution.Compat.Exception.html#catchIO"><span class="hs-identifier hs-var hs-var">catchIO</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; (IOException -&gt; IO a) -&gt; IO a
forall e a. Exception e =&gt; IO a -&gt; (e -&gt; IO a) -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#catch"><span class="hs-identifier hs-var">Exception.catch</span></a></span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span class="hs-comment">-- | Catch 'ExitCode'</span><span>
</span><span id="line-31"></span><span id="local-6989586621679612250"><span class="annot"><a href="Distribution.Compat.Exception.html#catchExit"><span class="hs-identifier hs-type">catchExit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679612250"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#ExitCode"><span class="hs-identifier hs-type">ExitCode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679612250"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679612250"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-32"></span><span id="catchExit"><span class="annot"><span class="annottext">catchExit :: forall a. IO a -&gt; (ExitCode -&gt; IO a) -&gt; IO a
</span><a href="Distribution.Compat.Exception.html#catchExit"><span class="hs-identifier hs-var hs-var">catchExit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; (ExitCode -&gt; IO a) -&gt; IO a
forall e a. Exception e =&gt; IO a -&gt; (e -&gt; IO a) -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#catch"><span class="hs-identifier hs-var">Exception.catch</span></a></span><span class="hs-cpp">

#if !MINVER_base_48
</span><span class="hs-identifier">displayException</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Exception.Exception</span><span> </span><span class="hs-identifier">e</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-identifier">e</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-36"></span><span class="hs-identifier">displayException</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">show</span><span class="hs-cpp">
#endif
</span></pre></body></html>